#include <iostream>
#include <fstream>
#include <string.h>


int main()
{
	char buff[256];
	std::ifstream fl("../data/txt/help.txt");
	if (!fl.good()) {
		std::cout << "Error opening file" << std::endl;
		return 0;
	}

	while( !fl.eof()) {
		std::cout << "seekg pointer: " << fl.tellg() << std::endl;
		fl.getline(buff,256);

		if (buff[0] == '$') {
			std::cout << "Found " << buff << " at " << fl.tellg() << std::endl;
			std::cout << "Actual at " << fl.tellg() - strlen(buff) - 1 << std:: endl;
		}
	}

	fl.seekg(0,std::ios::beg);
	fl.close();

	fl.open("../data/txt/help.txt");
	fl.seekg(426);

	fl.getline(buff,256);
	std::cout << "Index at 426 yields " << buff << std::endl;	

	fl.close();

	return 0;
}
